<template >
	<view calss="com-wap">
		<view class="page-block super-hot">
			<view class="hot-title-wap">
				<image src="/../static/icos/hot.png" class="hot-icon"></image>
				<!-- <view class="hot-title">{{tagTitle}}</view> -->
				<view class="hot-title">{{movie_title}}</view>

				
			</view>
			
		</view>
		<scroll-view scroll-x class="page-block hot-item">
			
			<view class="single-poster" v-for="hot in movie_list" :key="hot.id">
				<view class="poster-wepper">
					<image :src="hot.images.small" class="poster"></image>
					<view class="movie-name">
						{{hot.title}}
					</view>
					<view class="hot-rate-view">
						<uni-rate disabled="true" :value="hot.rating.average/2" size="14" class="hot-rate"></uni-rate>
						<view class="rate-num">{{hot.rating.average}}</view>
					</view>
				</view>
			</view>
			
			
		</scroll-view>
	</view>
</template>

<script>
	//import common from '../common/commonUrl.js';
	import uniRate from "@/components/uni-rate/uni-rate.vue";
	
	export default {
		
		data() {
			return {
				movie_title:'',
				movie_list:[]
			};
		},
		
		methods:{
			
		},
		
		props:['tagTitle','movieUrl'],
		//或者
		// props:{
		// 	
		// 	tagTitle:{  
  //               type:String,  
  //               default:""  
  //           },  
		// },
		created() {
			
			//静态获取
			//console.log(111111111) ; 
			// var tmp_url = 'top250';
			var movieUrl = this.movieUrl;
			var json_data = require('../static/mock_json/'+movieUrl+'.json');
			
			this.movie_list = json_data.subjects;
			this.movie_title = json_data.title;
			//console.log(json_data) ; 
			
			/* 
			//动态获取
			//从公共common.js获取
			var serverUrl = common.severUrl;
			var movieUrl = this.movieUrl;
			//请求正在热映
			uni.request({
				url : serverUrl ,
			
				method: 'GET',
				data: {'url_param':movieUrl},
				
				success: res => {
					console.log(res);
					if(res.statusCode == 200){
						this.movie_list = res.data.subjects;
						this.movie_title = res.data.title;

					}
				},
				fail: () => {},
				complete: () => {}
			}); */
		},
		components: {
			uniRate
			
		}
	}
</script>

<style>
@import url("../pages/index/index.css");

</style>
